<template>
	<view class="page">
		<headerVue :title="i18n.b14"></headerVue>

		<view class="thVue flex margin40 padding-row30">
			<view class="li w25">USDT</view>
			<view class="li w25">类型</view>
			<view class="li text-right w50">时间</view>
		</view>
		<view class="tdVue flex padding-row30 margin0" v-for="(item, index) in list" :key="index">
			<view class="li w25">{{item.amount}}</view>
			<view class="li w25">{{item.typeStr}}</view>
			<view class="li text-right w50">{{item.createTime}}</view>
		</view>

	</view>
</template>

<script>
	export default {
		data(){
			return {
				pageNum: 1,
				pageSize: 20,
				isLastPage: false,
				isEmpty: false,
				list: []
			}
		},
		computed:{
			i18n() {
				return this.$t("message");
			}
		},
		async onLoad() {
			await this.getList()
		},

		async onReachBottom() {
			if(this.isLastPage) return
			this.pageNum++
			await this.getList()
		},

		methods: {
			async getList(){
				const res = await this.$request("/front/financial/userHostingLog", {
					pageNum: this.pageNum,
					pageSize: this.pageSize,
				})
				if(res.code===0) {
					console.log(res)
					this.list = this.list.concat(res.data.list)
					this.isLastPage = res.data.isLastPage
				}
			}
		}
	}
</script>

<style lang="less" scoped>
	.tabVue {
		width: 670rpx;
		height: 98rpx;
		background: rgba(255,255,255,0.1);
		border-radius: 49rpx;
		.tab {
			width: 33.33333%;
			height: 98rpx;
			text-align: center;
			line-height: 98rpx;
			font-size: 28rpx;
			color: rgba(255,255,255,0.6);
		}
		.active {
			background: linear-gradient( 270deg, #49BA29 0%, #C5DF24 100%);
			color: #0F0F13;
			border-radius: 49rpx;
			font-weight: 600;
		}
	}

	.thVue {
		width: 670rpx;
		height: 78rpx;
		background: rgba(255,255,255,0.1);
		border-radius: 8rpx;
		.li {
			//width: 33.33333%;
			height: 78rpx;
			line-height: 78rpx;
			color: rgba(255,255,255,0.6);
		}
	}
	.tdVue {
		width: 670rpx;
		height: 78rpx;
		.li {
			//width: 33.33333%;
			height: 78rpx;
			line-height: 78rpx;
			color: rgba(255,255,255,0.6);
		}
	}

	.tdVue:nth-child(2n) {
		background: rgba(255,255,255,0.03);;
	}
</style>
